Access to the objects' inlink/outlinks that are with previous baseline

Hi everyone, i was trying to export objects from a module, and some objects have links to other module with previous baseline, for example /Flushing/ICD [10.0 Final 3.1] .

Here are my code to loop thru the links:

for l in o -> "*" do {

        string temp2 = sTargetPath1
       
        string sTargetPath = fullName(target l)
   
        if (null sTargetPath) {continue}
        
    
        if(exists(module sTargetPath) == true)
        {
            targetModule = read(sTargetPath, false)
        }
}      

 

the code works for the links with current baseline, but doesnt work for the case I decribed at the beginning. I tried to print out "sTargetPath" in the code, but i got nothing.  Anyone can help?

Thanks in advance.


JingC - Wed Aug 28 16:47:10 EDT 2013

Re: Access to the objects' inlink/outlinks that are with previous baseline
kourosh - Wed Aug 28 18:05:08 EDT 2013

add 'all' to your for statement:

for l in all o -> "*" do {

Re: Access to the objects' inlink/outlinks that are with previous baseline
JingC - Thu Aug 29 10:07:26 EDT 2013

kourosh - Wed Aug 28 18:05:08 EDT 2013

add 'all' to your for statement:

for l in all o -> "*" do {

Thanks for replying.

Your way seems not working though.

 

Re: Access to the objects' inlink/outlinks that are with previous baseline
sekrbo - Thu Aug 29 10:23:04 EDT 2013

well I think you have to muck about with the versions as well.

The code that the traceability wizard generates might give you an idea.

...
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
...
    string linkModName = "*"
    for l in all(o->linkModName) do {
        otherVersion = targetVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        othero = target l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = target l
...

/sekrbo

Re: Access to the objects' inlink/outlinks that are with previous baseline
GregM_dxler - Thu Aug 29 10:33:23 EDT 2013

JingC - Thu Aug 29 10:07:26 EDT 2013

Thanks for replying.

Your way seems not working though.

 

sekrbo is right.  The 'all' in for l in all o will loop through all outgoing links, including ones going to baselines.

However, to get that information, you need to load the baseline version, not just read the target module.

Greg

Re: Access to the objects' inlink/outlinks that are with previous baseline
JingC - Thu Aug 29 10:40:18 EDT 2013

sekrbo - Thu Aug 29 10:23:04 EDT 2013

well I think you have to muck about with the versions as well.

The code that the traceability wizard generates might give you an idea.

...
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
...
    string linkModName = "*"
    for l in all(o->linkModName) do {
        otherVersion = targetVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        othero = target l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = target l
...

/sekrbo

quick question Sekrbo. how to use traceability wizard? where can i pull it up?

Re: Access to the objects' inlink/outlinks that are with previous baseline
kourosh - Thu Aug 29 13:50:14 EDT 2013

JingC - Thu Aug 29 10:40:18 EDT 2013

quick question Sekrbo. how to use traceability wizard? where can i pull it up?

from the module menu... Analysis > Wizard... then when the resulting trace column is created, right click on the column title and select properties > browse > current to see the DXL generated by the analysis wizard